﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Globalization;

namespace VirtualDisk
{
    
    class Program
    {
             static void Main(string[] argv)
             {

                 try
                 {
                     printPWD();
                     MyString str = null;
                     Command command;
                     SimpleCommandFactory cfactory = new SimpleCommandFactory();
                     str = new MyString(Console.ReadLine());
                     while (str != null)
                     {
                         command = cfactory.createCommand(str);
                         command.execute();
                         Console.WriteLine();
                         printPWD();
                         str = new MyString(Console.ReadLine());
                     }
                 }
                 catch (Exception e)
                 {
                     Console.WriteLine("未知错误！");
                 }
               
             }
            
             static void printPWD()
             {
                 MyString pwd = DiskTree.getInstance().getPWDPath();
                 Console.Write(pwd.ToString()+">");
             }
           
     
     }

    
}

